<!DOCTYPE html>
<html class="x-admin-sm">
<head>
<meta charset="UTF-8">
<title></title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="__ADMIN__/css/font.css">
<link rel="stylesheet" href="__ADMIN__/css/xadmin.css">
<script type="text/javascript" src="__ADMIN__/js/jquery.min.js"></script>
<script type="text/javascript" src="__ADMIN__/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="__ADMIN__/js/xadmin.js"></script>
<script type="text/javascript" src="__ADMIN__/js/cookie.js"></script>

</head>

<body>
<div class="x-nav">
<span class="layui-breadcrumb">
<a><cite>{$nav}</cite></a>
</span>
<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
<i class="layui-icon layui-icon-refresh-3" style="line-height:30px"></i></a>
</div>
<div class="x-body x-admin">
    <!--<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">-->
    <!--    <legend>海豚直播销售部晋升机制</legend>-->
    <!--</fieldset>-->
    <div class="layui-table-body layui-table-main" style="width: 100%;min-height:0;">
        <table class="layui-table layui-form" lay-filter="dataTable" id="dataTable"> </table>
    </div>
    <div class="layui-table-body layui-table-main" style="width: 100%;min-height:0;">
        <table class="layui-table layui-form" lay-filter="dataTable1" id="dataTable1"> </table>
    </div>
</div>
<script type="text/html" id="barDemo">
  <a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="edit">编辑</a>
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script type="text/html" id="toolbarDemo">
  <div class="layui-btn-container">
    <button class="layui-btn" onclick="x_admin_show('添加记录','{:url('dataTable/liveBookAdd')}','','650','550')">添加</button>
  </div>
</script>
<script>
  layui.use(['form','layer','jquery','table','util'], function(){
    form = layui.form,
    layer = layui.layer
    ,$ = layui.jquery
    ,table = layui.table
    ,util = layui.util;
    
      table.render({
        elem: '#dataTable'
        ,url:'{:url('admin/staff/job_list')}?keyword={:input()['keyword']}'
        ,toolbar: '#toolbarDemo' 
        ,defaultToolbar: ['filter', 'exports', 'print']
        ,limit: 50
        ,title: '海豚直播销售部晋升机制'
        ,cols: [[
          //{field:'id', width:70, sort: true,title:"编号"},
          {field:'name',  title:"岗位", edit: 'text'},
          {field:'yjyq',width:200, title:"业绩要求", edit: 'text'},
          {field:'rcpy', width:200,title:"人才培养", edit: 'text'},
          {field:'gjzb',width:200,title:"关键指标", edit: 'text'},
          {field:'bjzb', width:200,title:"保级指标", edit: 'text'},
          {field:'jjzb', width:200,title:"降级", edit: 'text'},
          {field:'gwhf', width:200,title:"岗位恢复", edit: 'text'},
          {field:'sort', width:80,title:"排序", edit: 'text'},
          {fixed:'right', width:150,title:"操作",toolbar: '#barDemo'},
        ]]
        ,page: false
         ,done: function(res, curr, count){
            $(".layui-table-main tr").each(function (index, val) {
                $($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
                $($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
            })
          }

      });
      table.render({
        elem: '#dataTable1'
        ,url:'{:url('admin/staff/job_list')}?keyword={:input()['keyword']}'
        ,toolbar: '#toolbarDemo1' 
        ,defaultToolbar: ['filter', 'exports', 'print']
        ,limit: 50
        ,title: '销售部三级九岗薪酬体系'
        ,cols: [[
          //{field:'id', width:70, sort: true,title:"编号"},
          {field:'name',  title:"岗位", edit: 'text'},
          {field:'jcgz',width:180, title:"基础工资", edit: 'text'},
          {field:'jxgz', width:180,title:"绩效工资", edit: 'text'},
          {field:'qqj',width:180,title:"全勤奖", edit: 'text'},
          {field:'grtc', width:180,title:"个人提成", edit: 'text'},
          {field:'gltc', width:180,title:"管理提成", edit: 'text'},
          {field:'tdlrfh', width:180,title:"团队利润分红", edit: 'text'},
          {field:'bmlrfh', width:180,title:"分子团队/部门利润分红", edit: 'text'},
          {fixed:'right', width:150,title:"操作",toolbar: '#barDemo'},
        ]]
        ,page: false
      });
      
      table.on('tool(dataTable)', function(obj){
        var data = obj.data;
        if(obj.event === 'del'){
          layer.confirm('确认要删除吗？',function(index){
              $.ajax({
                type:'POST',
                dataType:'json',
                data:{id:data.id},
                url:"{:url('staff/job_del')}",
                success:function(o){
                  layer.msg(o.msg,{icon:o.icon,time:1000});
                  obj.del();
                }
              });
          });
        } else if(obj.event === 'edit'){
          x_admin_show('查看详情','{:url('staff/job_edit')}/id/'+data.id,'','650','550')
        }
      });
      table.on('tool(dataTable1)', function(obj){
        var data = obj.data;
        if(obj.event === 'del'){
          layer.confirm('确认要删除吗？',function(index){
              $.ajax({
                type:'POST',
                dataType:'json',
                data:{id:data.id},
                url:"{:url('staff/job_del')}",
                success:function(o){
                  layer.msg(o.msg,{icon:o.icon,time:1000});
                  obj.del();
                }
              });
          });
        } else if(obj.event === 'edit'){
          x_admin_show('查看详情','{:url('staff/job_edit')}/id/'+data.id,'','650','550')
        }
      });
        
        table.on('edit(dataTable)', function(obj){
            var value = obj.value 
            ,data = obj.data 
            ,field = obj.field;
            $.get('{:url('staff/job_setField')}?id='+data.id+'&field='+field+'&value='+util.escape(value),function(data){
                layer.msg(data.msg);
            })
        });
        table.on('edit(dataTable1)', function(obj){
            var value = obj.value 
            ,data = obj.data 
            ,field = obj.field;
            $.get('{:url('staff/job_setField')}?id='+data.id+'&field='+field+'&value='+util.escape(value),function(data){
                layer.msg(data.msg);
            })
        });
        
  });

</script>
</body>

</html>